home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc B) / Acorn User China CD-ROM (UK) (Disc B).bin / BARNET / ARMLINUX / MAIL / 9807 / text0145.txt < prev    next >
Encoding:
Text File  |  1998-08-03  |  4.8 KB  |  138 lines

  1. In message <E0yreuW-0006Zi-00@spring.nexus.co.uk>
  2.      Philip Blundell wrote:
  3.  
  4. > No; ELF symbols have _no_ leading underscore.  The `__' symbols are probably 
  5. > functions in libgcc.  If you post the actual messages I might be able to guess 
  6. > what's wrong.
  7.  
  8. Then I probably did something wrong. I'm going to start (almost) from
  9. scratch.
  10.  
  11. Here's a more detailed description of errors I came across when
  12. compiling gcc 2.8.1 for ELF. Previous steps like compiling gcc and
  13. binutils for a.out and compiling binutils for ELF were ok.
  14. Configure was run as follows:
  15.  
  16. # ./configure  --target=arm-unknown-linuxelf --host=arm-unknown-linuxaout --prefix=/usr/local
  17.  
  18. So the system should produce ELF but run on an a.out machine.
  19.  
  20. [voss@yoda gcc-2.8.1]$ make LANGUAGES=c
  21. ...
  22. rm -f tmplibgcc1.a libgcc1.S
  23. cp ./config/arm/lib1funcs.asm libgcc1.S
  24. for name in _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx; \
  25. do \
  26.   echo ${name}; \
  27.   ./xgcc -B./ -O2 -fomit-frame-pointer  -DCROSS_COMPILE -DIN_GCC    -g
  28. -I./include  -g0 -I. -I. -I./config -c -DL${name} libgcc1.S; \ 
  29.   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  30.   mv libgcc1.o ${name}.o; \
  31.   /usr/local/arm-unknown-linuxelf/bin/ar rc tmplibgcc1.a ${name}.o; \
  32.   rm -f ${name}.o; \
  33. done
  34. _udivsi3
  35. _divsi3
  36. _umodsi3
  37. _modsi3
  38. _dvmd_lnx
  39. libgcc1.S:430: asm/unistd.h: No such file or directory
  40.  
  41. Hmm, asm/unistd.h cannot be found but I'm sure I have such a file
  42.  
  43. [voss@yoda include]$ ls -l /usr/include/asm/unistd.h
  44. -rw-r--r--   1 root     root        11931 Jun 20 13:49 /usr/include/asm/unistd.h
  45.  
  46. Let's see what directories unistd.h is looked for:
  47.  
  48. [voss@yoda gcc-2.8.1]$ ./xgcc -v  -B./ -O2 -fomit-frame-pointer 
  49. -DCROSS_COMPILE -DIN_GCC    -g -I./include  -g0 -I. -I. -I./config -c
  50. -DL_dvmd_lnx libgcc1.S  
  51. Reading specs from ./specs
  52. gcc version 2.8.1
  53.  ./cpp -lang-asm -v -I./include -I. -I. -I./config -isystem ./include
  54. -undef -$ -Dunix -Darm -Dlinux -D__ELF__ -D__unix__ -D__arm__ -D__linux__
  55. -D__ELF__ -D__unix -D__arm -D__linux -Asystem(unix) -Asystem(posix)
  56. -Acpu(arm) -Amachine(arm) -D__ASSEMBLER__ -D__CHAR_UNSIGNED__
  57. -D__OPTIMIZE__ -g -g0 -D__ARM_ARCH_3__ -D__APCS_26__ -DCROSS_COMPILE
  58. -DIN_GCC -DL_dvmd_lnx libgcc1.S /tmp/cca10581.s     
  59. GNU CPP version 2.8.1 (ARM GNU/Linux with ELF)
  60. #include "..." search starts here:
  61. #include <...> search starts here:
  62.  include
  63.  .
  64.  config
  65.  include
  66. End of search list.
  67. libgcc1.S:430: asm/unistd.h: No such file or directory
  68.  
  69. So asm/unistd.h is not found because /usr/include isn't searched. 
  70. That probably ok because we don't want to handle system includes at
  71. this stage of the compilation. I'll just make a link so that
  72. asm/unistd.h is found.
  73.  
  74. [voss@yoda asm]$ pwd  
  75. /export/gcc-2.8.1/include/asm
  76. [voss@yoda asm]$ ls -l
  77. total 0
  78. lrwxrwxrwx   1 voss     voss           25 Jul  9 13:16 unistd.h -> /usr/include/asm/unistd.h
  79.  
  80. [voss@yoda gcc-2.8.1]$ make LANGUAGES=c
  81. ...
  82. gcc -v -c -DCROSS_COMPILE -DIN_GCC    -g  -DHAVE_CONFIG_H    -I. -I. -I./config ./cp/g++spec.c
  83. Reading specs from ./specs
  84. gcc version 2.8.1
  85.  /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/cpp -lang-c -v -I. -I.
  86. -I./config -undef -D__GNUC__=2 -D__GNUC_MINOR__=8 -Dunix -Darm -Dlinux
  87. -D__ELF__ -D__unix__ -D__arm__ -D__linux__ -D__ELF__ -D__unix -D__arm
  88. -D__linux -Asystem(unix) -Asystem(posix) -Acpu(arm) -Amachine(arm)
  89. -D__CHAR_UNSIGNED__ -g -D__ARM_ARCH_3__ -D__APCS_26__ -DCROSS_COMPILE
  90. -DIN_GCC -DHAVE_CONFIG_H ./cp/g++spec.c /tmp/cca11608.i 
  91. GNU CPP version 2.8.1 (ARM GNU/Linux with a.out)
  92. #include "..." search starts here:
  93. #include <...> search starts here:
  94.  .
  95.  config
  96.  /usr/local/include
  97.  /usr/arm-unknown-linuxaout/include
  98.  /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/include
  99.  /usr/include
  100. End of search list.
  101.  /usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1/cc1 /tmp/cca11608.i -quiet
  102. -dumpbase g++spec.c -g -version -o /tmp/cca11608.s 
  103. GNU C version 2.8.1 (arm-unknown-linuxaout) compiled by GNU C version 2.8.1.
  104.  as -o g++spec.o /tmp/cca11608.s
  105. gcc -v -DCROSS_COMPILE -DIN_GCC    -g  -DHAVE_CONFIG_H  -o g++ g++.o g++spec.o prefix.o \
  106.   version.o choose-temp.o pexecute.o  obstack.o ` case "gcc -v" in "cc") echo "" ;; esac `  
  107. Reading specs from ./specs
  108. gcc version 2.8.1
  109.  ld -dynamic-linker /lib/elf/ld-linux.so.2 -o g++ crt1.o crti.o
  110. ./crtbegin.o -L/usr/local/qt/lib -L.
  111. -L/usr/lib/gcc-lib/arm-unknown-linuxaout/2.8.1
  112. -L/usr/arm-unknown-linuxaout/lib g++.o g++spec.o prefix.o version.o
  113. choose-temp.o pexecute.o obstack.o -lgcc -lc -lgcc ./crtend.o crtn.o  
  114. ld: cannot open crt1.o: No such file or directory
  115. make: *** [g++] Error 1
  116.  
  117. Why is g++ built now? I thought I only told make to build the C
  118. compiler, not the C++ compiler. And why does ld try to produce an ELF
  119. binary? Should that be still an a.out binary?
  120.  
  121. Maybe I have progressed too far. Isn't xgcc the result I wanted? A
  122. C compiler running as a.out producing ELF.
  123.  
  124. > p.
  125.  
  126. Regards,
  127.    Stefan
  128.  
  129. -- 
  130. Stefan Voss
  131. (voss@yoda.in-berlin.de)
  132.  
  133. unsubscribe: body of `unsubscribe linux-arm' to majordomo@vger.rutgers.edu
  134.  
  135.